" 在浏览器预览 for win32
function! ViewInBrowser(name)
    let file = expand("%:p")
    exec ":update " . file
    let l:browsers = {
		\ "cr":"C:/Program Files (x86)/Google/Chrome/Application/chrome.exe",
		\ "ff":"D:/Program Files/Mozilla Firefox/firefox.exe",
		\ "ie6":"D:/Program Files/Core Services/IETester/IETester.exe -ie6",
		\ "ie7":"D:/Program Files/Core Services/IETester/IETester.exe -ie7",
		\ "ie8":"D:/Program Files/Core Services/IETester/IETester.exe -ie8",
		\ "ie9":"C:/Program Files/Internet Explorer/iexplore.exe",
		\ "cr360":"D:/Program Files/360Chrome/Chrome/Application/360chrome.exe"
		\}
    let htdocs='E:\\apmxe\\htdocs\\'
    let strpos = stridx(file, substitute(htdocs, '\\\\', '\', "g"))
    if strpos == -1
       exec ":silent !start ". l:browsers[a:name] ." file://" . file
    else
        let file=substitute(file, htdocs, "http://127.0.0.1:8090/", "g")
        let file=substitute(file, '\\', '/', "g")
        exec ":silent !start ". l:browsers[a:name] file
    endif
endfunction
nmap <f12>c :call ViewInBrowser("cr")<cr>
nmap <f12>f :call ViewInBrowser("ff")<cr>
nmap <f12>6 :call ViewInBrowser("ie6")<cr>
nmap <f12>7 :call ViewInBrowser("ie7")<cr>
nmap <f12>8 :call ViewInBrowser("ie8")<cr>
nmap <f12>9 :call ViewInBrowser("ie9")<cr>
nmap <f12>360 :call ViewInBrowser("cr360")<cr>
